package com.zhan.ielts.dao.impl.word;

import com.zhan.frame.core.dao.impl.BaseDaoImpl;
import com.zhan.frame.core.exception.DaoException;
import com.zhan.frame.core.utils.BeanUtils;
import com.zhan.ielts.dao.word.DictionaryDao;
import com.zhan.ielts.domain.word.Dictionary;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public class DictionaryDaoImpl extends BaseDaoImpl<Dictionary> implements
		DictionaryDao {

	@Override
	public List<Dictionary> selectTemp(Dictionary query) {
		try {
			Map<String, Object> params = BeanUtils.toMap(query);
			return sqlSessionTemplate.selectList(getSqlName("selectTemp"),
					params);
		} catch (Exception e) {
			throw new DaoException(String.format("查询对象列表出错！语句：%s",
					getSqlName("selectTemp")), e);
		}
	}

}
